home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / wcl-21.lha / wcl-2.1 / src / compiler / common / macros.lisp < prev    next >
Text File  |  1992-09-10  |  847b  |  27 lines

  1. ;;; (C) Copyright 1990-1992 by Wade L. Hennessey. All rights reserved.
  2.  
  3. (defmacro defprimitive (name in/out &body body)
  4.   (multiple-value-bind (ins outs in-types out-types)
  5.       (parse-in/out in/out)
  6.     `(eval-when (compile load eval)
  7.       (define-primitive
  8.       ',name ',ins ',outs
  9.       (mapcar #'c-type-name->c-type-object ',in-types)
  10.       (mapcar #'c-type-name->c-type-object ',out-types)
  11.       #'(lambda ,ins ,@body)))))
  12.  
  13. (defmacro emit-c (string &rest args)
  14.   `(format *c-stream* ,string ,@args))
  15.  
  16. (defmacro emit-lc (tree string &rest args)
  17.   `(progn (emit-source-line ,tree)
  18.     (format *c-stream* ,string ,@args)))
  19.  
  20. (defmacro emit-k (string &rest args)
  21.   `(format *k-stream* ,string ,@args))
  22.  
  23. (defmacro emit-win (string &rest args)
  24.   `(format *win-stream* ,string ,@args))
  25.  
  26. ;;; other macros are already in the library or in com/cross/macros.lisp
  27.